package com.xj0927.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: xj0927
 * @Description:
 * @Date Created in 2020-10-22 20:19
 * @Modified By:
 */
@Configuration  //1.添加第1处
public class ApplicationConfiguration {

    @Bean //2.添加第2处
    //@LoadBalanced //赋予其负载均衡的能力，不再关注端口号！【默认使用轮询：交替使用】
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
